const cellRenderer = (params) => {
  return `<div style="background: ${params.data.colorId}; width: 98%; height: 88%;">${params.value}</div>`
}
const commonColumn = [
  { headerName: "主线ID", field: "machineGroup", minWidth: 100, flex: 1 },
  { headerName: "父设备", field: "topId", minWidth: 100, flex: 1 },
  { headerName: "设备Id", field: "machineId", minWidth: 100, flex: 1 },
  // { headerName: "变更事件", field: "eventName", minWidth: 120, flex: 1 },
  // { headerName: "损失类型", field: "lossType", minWidth: 100, flex: 1 },
  { headerName: "开始时间", field: "createTime", minWidth: 150, flex: 1 },
  { headerName: "结束时间", field: "endTime", minWidth: 150, flex: 1 },
  { headerName: "持续时长", field: "keepTime", minWidth: 70, flex: 1 },
  { headerName: "停机区分", field: "shutdownType", minWidth: 70, flex: 1 },
  { headerName: "前状态", field: "preEptStatus", minWidth: 70, flex: 1 },
  { headerName: "现状态", field: "eptStatus", minWidth: 70, flex: 1, cellRenderer },
  { headerName: "硬件状态", field: "processStatus", minWidth: 70, flex: 1 },
  { headerName: "通信状态", field: "hardwareStatus", minWidth: 70, flex: 1 },
  { headerName: "RCode", field: "rcode", minWidth: 100, flex: 1 },
  { headerName: "Code描述", field: "description", minWidth: 80, flex: 1 },
  { headerName: "制造类型", field: "modelType", minWidth: 70, flex: 1 },
  { headerName: "设备类型", field: "machineType", minWidth: 70, flex: 1 },
  { headerName: "源设备ID", field: "fromId", minWidth: 100, flex: 1 },
  { headerName: "源设备类型", field: "fromType", minWidth: 100, flex: 1 }
]

export const allColumn = [
  ...commonColumn,
  { headerName: "备注信息", field: "newRemak", minWidth: 200, flex: 1, filter: 'agMultiColumnFilter' }
]

export const downColumn = [
  ...commonColumn,
  { headerName: "报警ID", field: "alarmId", minWidth: 70, flex: 1, filter: 'agMultiColumnFilter' },
  { headerName: "发报警时间", field: "alarmSendTime", minWidth: 150, flex: 1, filter: 'agMultiColumnFilter' },
  { headerName: "读报警时间", field: "alarmReadTime", minWidth: 150, flex: 1, filter: 'agMultiColumnFilter' },
  { headerName: "消报警时间", field: "alarmEndTime", minWidth: 100, flex: 1, filter: 'agMultiColumnFilter' },
  { headerName: "报警文本", field: "alarmText", minWidth: 100, flex: 1, filter: 'agMultiColumnFilter' },
  { headerName: "读报警损失/秒", field: "readLossTime", minWidth: 100, flex: 1, filter: 'agMultiColumnFilter' },
  { headerName: "消报警损失/秒", field: "clearLossTime", minWidth: 100, flex: 1, filter: 'agMultiColumnFilter' },
  { headerName: "备注信息", field: "newRemak", minWidth: 200, flex: 1, filter: 'agMultiColumnFilter' }
]

export const pmColumn = [
  ...commonColumn
]

commonColumn.forEach((item) => {
  item.filter = 'agMultiColumnFilter'
})
